<%@LANGUAGE="VBSCRIPT" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Admin Appliances</title>
<link href="UniversalStyleSheet.css" rel="stylesheet" type="text/css" />

</head>

<body>
<%
set fs=server.CreateObject("scripting.filesystemobject")

action=request.QueryString("action")
if action="save" then
	set ts=fs.opentextfile(server.MapPath("access/backend/appliances.txt"),2)
	ts.write (request.Form("appliancelist"))
	%>
	<script type="text/javascript">
		alert( "Appliances Saved.")
		window.location="AdminAppliances.asp"
	</script>
	<%
	ts.close
	set ts=nothing
	set fs=nothing
	response.End()
end if


t=""
set tf=fs.opentextfile(server.MapPath("access/backend/appliances.txt"))
do until tf.atendofstream
	t=t & tf.readline & vbcrlf
loop
tf.close
set tf=nothing
set fs=nothing
%>

<form id="applianceForm" name="applianceForm" method="post" action="AdminAppliances.asp?action=save">

  <p>&nbsp;</p>
  <table width="500" border="0" cellpadding="0" cellspacing="1" bgcolor="#006600" style="border-style:outset; border-width:thin">
    <tr>
      <td bgcolor="#FFFFFF"><span class="TableTitles">Appliances<br /></span>
<textarea name="appliancelist" cols="60" rows="30" id="appliancelist">
<%= t %>
</textarea>
      </td>
    </tr>
    <tr>
      <td align="right" bgcolor="#FFFFFF"><img src="Images/SaveButton.png" alt="Save" width="60" height="30" onclick="javascriptscript: applianceForm.submit()"/>&nbsp; </td>
    </tr>
  </table>
</form>
</body>
</html>
